package com.longcai.cm.moudules.system.bean;//package com.longcai.cm.moudules.system.bean;

import com.baomidou.mybatisplus.annotation.TableField;
import com.longcai.cm.moudules.system.domain.SysMenus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@ApiModel(description = "树形结构数据")
@Data
public class MenuTreeBean {

    @ApiModelProperty(value = "主键id")
    private String id;

    @ApiModelProperty(value = "父级id")
    private String pid;

    @ApiModelProperty(value = "菜单名称")
    private String name;

    @ApiModelProperty(value = "菜单名称")
    private String label;

    @ApiModelProperty(value = "菜单编码")
    private String code;

    private String pcode;

    @ApiModelProperty(value = "跳转地址")
    private String pageurl;

    @ApiModelProperty(value = "菜单图标")
    private String icon;

    @ApiModelProperty(value = "创建时间")
    private String createdate;

    @ApiModelProperty(value = "备注")
    private String remark;

    private String editdate;

    @ApiModelProperty(value = "排序号码")
    private Integer orderno;

    private String level;

    private String title;
    private Boolean expand = true;
    private Boolean selected = false;
    private Boolean checked = false;

    private Integer showFlag;

    @TableField(exist = false)
    @ApiModelProperty(value = "下级菜单")
    List<MenuTreeBean> children;


    public MenuTreeBean() {
    }


    public MenuTreeBean(SysMenus systemMenu) {
        this.id = systemMenu.getId();
        this.name = systemMenu.getName();
        this.label = systemMenu.getName();
        this.code = systemMenu.getCode();
        this.pageurl = systemMenu.getPageurl();
        this.orderno = systemMenu.getOrderNo();
        this.icon = systemMenu.getIcon();
        this.showFlag = systemMenu.getShowFlag();
        this.remark = systemMenu.getRemark();
    }
}
